package com.panshi.qa.api.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class ItemQueryVo {
    @ApiModelProperty("当前页")
    private Integer current;
    @ApiModelProperty("区分 0 已答  1未答")
    private Integer replyStatus;
    @ApiModelProperty("口腔类型ID")
    private Long cateId;
    @ApiModelProperty("10推荐   15已答   20未答")
    private Integer type;
    @ApiModelProperty("总记录数")
    private Integer total;
    @ApiModelProperty("分页大小")
    private Integer pageSize;
    @ApiModelProperty("搜索对象")
    private SearchParams searchParams;
    //获取当前查询页的起始下标
    public Integer getStartIndex() {
        Integer value = 0;
        if(current == null || current == 0) {
            value = 0;
        }else if(current != null) {
            value = (current-1)*getPageSize();
        }
        return value;
    }
    public Integer getPageSize() {
        Integer value = 0;
        if(pageSize == null || pageSize == 0) {
            value = 10;
        }else if(pageSize!=null) {
            value = pageSize;
        }
        return value;
    }

}
